package com.taxi.comm.business.service.M003;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.taxi.comm.business.beans.YCMXB_BW;
import com.taxi.comm.business.beans.YcmxbBwZfmx;
import com.taxi.comm.business.mapper.YCMXB_BWMapper;
import com.taxi.comm.business.beans.YcmxbBwZfmxExample;
import com.taxi.comm.business.mapper.YcmxbBwZfmxMapper;


@Service
public class M003ServiceImpl  extends M003Service {

	private static final Logger log = LoggerFactory.getLogger(M003ServiceImpl.class);
	
	@Autowired
	private YCMXB_BWMapper  ycmxb_bw_Mapper;
	@Autowired
	private YcmxbBwZfmxMapper ycmxbwzfmx_Mapper;
	
	
	
	
	

	void signIn(M003Request request) throws Exception {
		YCMXB_BW ycmxb_bw=new YCMXB_BW();
		
		Date aDate = new Date(); 
		SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); 
		String formattedDate = formatter.format(aDate); 
		ycmxb_bw.setZXRQ(Integer.parseInt(formattedDate,10));
		ycmxb_bw.setZXLS(ycmxb_bw_Mapper.nextYCMXB_BWSeq());
		ycmxb_bw.setVer(request.Ver);
		ycmxb_bw.setBWLS(request.BWLS);
		ycmxb_bw.setBWLX(request.BWLX);
		ycmxb_bw.setQQBZ(request.QQBZ);
		ycmxb_bw.setYDDM(request.YDDM);
		ycmxb_bw.setFSF(request.FSF);
		ycmxb_bw.setJSF(request.JSF);
		ycmxb_bw.setSCSJ1(request.SCSJ);
		ycmxb_bw.setBWXH(request.BWXH);
		ycmxb_bw.setXTMC(request.XTMC);
		
		
		ycmxb_bw.setYCPT(request.YCPT);
		ycmxb_bw.setLXH(request.LXH);
		ycmxb_bw.setSBHM(request.SBHM);
		ycmxb_bw.setYCZL(request.YCZL);
		ycmxb_bw.setYCLX(request.YCLX);
		ycmxb_bw.setCPH(request.CPH);
		ycmxb_bw.setYYZH(request.YYZH);
		ycmxb_bw.setZYZH(request.ZYZH);
		ycmxb_bw.setSJXM(request.SJXM);
		ycmxb_bw.setCZGS(request.CZGS);
		ycmxb_bw.setYCSJ(request.YCSJ);
		ycmxb_bw.setJDDDWD(request.JDDDWD);
		ycmxb_bw.setJDDDJD(request.JDDDJD);
		ycmxb_bw.setSCSJ(request.SHCSJ);
		ycmxb_bw.setSCDDWD(request.SCDDWD);
		ycmxb_bw.setSCDDJD(request.SCDDJD);
		ycmxb_bw.setSCDD(request.SCDD);
		ycmxb_bw.setMPHM(request.MPHM);
		ycmxb_bw.setKJLK(request.KJLK);
		ycmxb_bw.setDBMC(request.DBMC);
		ycmxb_bw.setXCSJ(request.XCSJ);
		ycmxb_bw.setXCDD(request.XCDD);
		ycmxb_bw.setLC(request.LC);
		ycmxb_bw.setDHSJ(request.DHSJ);
		ycmxb_bw.setCF(request.CF);
		ycmxb_bw.setDDF(request.DDF);
		ycmxb_bw.setLQF(request.LQF);
		ycmxb_bw.setRYFJF(request.RYFJF);
		ycmxb_bw.setQTF(request.QTF);
		ycmxb_bw.setCKDH(request.CKDH);
		ycmxb_bw.setSJDH(request.SJDH);
		ycmxb_bw.setBZ(request.BZ);
		ycmxb_bw_Mapper.insert(ycmxb_bw);
		
		
		YcmxbBwZfmx ycmxbwzfmx =new YcmxbBwZfmx();
		for (int i=0;i<request.rownum;i++) {
			M003ZFMX rec =(M003ZFMX)request.m003zfmx.get(i);
			
			
			//System.out.println(ycmxbwzfmx_Mapper.nextYCMXB_BW_ZFMXSeq());
			
			
			ycmxbwzfmx.setPid(0);
			ycmxbwzfmx.setYczz(ycmxb_bw.getZXLS());
			ycmxbwzfmx.setXh(Short.parseShort(rec.getXH()));
			ycmxbwzfmx.setZffs(rec.getZFFS());
			ycmxbwzfmx.setZfje(rec.getZFJE());
			ycmxbwzfmx.setYhje(rec.getYHJE());
			ycmxbwzfmx.setJlje(rec.getJLJE());
			ycmxbwzfmx.setZfzh(rec.getZFZH());
			ycmxbwzfmx.setZflsh(rec.getZFLSH());
			ycmxbwzfmx.setBz(rec.getBZ());
			ycmxbwzfmx_Mapper.insert(ycmxbwzfmx);
		
		
		}
	}

	
	
	
	public static void main(String[] args) {
		
		System.out.println(Integer.MAX_VALUE);
		
	}




	
	
}
